a = [1, 2, 3, 4, 5, 6]
# 索引
a[0] = 9
print(a)
# 2 3 4下标元素重新赋值
a[2:5] = [13, 14, 15]
print(a)
# 按下标删除，删除第一个元素
del a[0]
print(a)
# 按值删除元素6
a.remove(6)
print(a)
# 删除最后一个
a.pop()
print(a)
# 删除倒数第一个
a.pop(-1)
print(a)

a = [1, 2, 3, 4, 5, 6]
print(len(a), max(a), min(a))
# 截取 start:end:步长， start=0可省略，end为最后一位可省略
print(a[1::2])

[1, 2, 3] + [4, 5, 6]  # [1, 2, 3, 4, 5, 6]	组合
['Hi!'] * 4  # ['Hi!', 'Hi!', 'Hi!', 'Hi!'] 重复
3 in [1, 2, 3]  # True	元素是否存在于列表中
for x in [1, 2, 3]: print(x, end=" ")  # 1 2 3	迭代

import operator

a = [1, 2]
b = [2, 3]
c = [2, 3]
print("operator.eq(a,b): ", operator.eq(a, b))
print("operator.eq(c,b): ", operator.eq(c, b))

list1 = [1, 2, 4, 6, 9]
list2 = [5, 8, 1, 9, 4]
list3 = [8, 2, 6, 3, 7]

list_all = list1 + list2 + list3
dc = {}
for i in range(1, 10):
    dc[i] = list_all.count(i)
print(dc)